package com.example.obs.service.ShareService;

import com.example.obs.dao.ShareMapper;
import com.example.obs.model.domin.Share;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Transactional
@Service
public class ShareServiceImpl implements ShareService{

    @Autowired
    private ShareMapper shareMapper;

    @Override
    public void addShare(Share share){
        shareMapper.addShare(share);
    }

    @Override
    public void removeShare(String shareId){shareMapper.deleteByPrimaryKey(shareId);}

    @Override
    public Share selectShare(String shareId){ return shareMapper.selectByPrimaryKey(shareId);}

}
